package com.xmall.member.service.impl;

import com.xmall.define.dto.login.MemberDto;
import com.xmall.member.entity.Member;
import com.xmall.member.mapper.MemberMapper;
import com.xmall.member.service.IMemberService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.xmall.utils.XmallUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author xmall
 * @since 2023-11-14
 */
@Service
public class MemberServiceImpl extends ServiceImpl<MemberMapper, Member> implements IMemberService {

    /**
     * 详情
     */
    @Override
    public MemberDto info(Long id) {
        Member entity = this.getById(id);
        XmallUtils.notNull(entity);

        MemberDto memberDto = new MemberDto();
        BeanUtils.copyProperties(entity, memberDto);
        return memberDto;
    }
}
